package com.example.littleken.ormlite_text.bean;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.io.Serializable;

/**日记实体类
 * Created by littleken on 2018/6/15.
 */
@DatabaseTable(tableName = "tb_lifediary")
public class LifeDiary implements Serializable{
    //id，由数据库自动生成
    @DatabaseField(generatedId = true)
    private int id;

    //题目
    @DatabaseField(columnName = "title")
    private String title;

    //内容
    @DatabaseField(columnName = "message")
    private String message;

    //创建时间
    @DatabaseField(columnName = "createtime")
    private String createtime;

    public LifeDiary() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCreatetime() {
        return createtime;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }
    //初始化
    public LifeDiary(String title, String message, String createtime) {
        this.title = title;
        this.message = message;
        this.createtime = createtime;
    }

    @Override
    public String toString() {
        return "LifeDiary{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", message='" + message + '\'' +
                ", createtime='" + createtime + '\'' +
                '}';
    }
}
